package com.hwua.service.Impl;

import com.hwua.dao.IShopCartDao;
import com.hwua.dao.Impl.ShopCartDaoImpl;
import com.hwua.entity.Product;
import com.hwua.entity.ProductExtend;
import com.hwua.entity.ShopCart;
import com.hwua.service.IShopCartService;

import java.sql.SQLException;
import java.util.List;

public class ShopCartServiceImpl implements IShopCartService {
    private IShopCartDao shopCartDao=new ShopCartDaoImpl();

    @Override
    public int insertShoItem(ShopCart shopCart) throws Exception {
        return shopCartDao.insert(shopCart);
    }

    @Override
    public List<ProductExtend> queryShopCartByuid(int uid) throws Exception {
        return shopCartDao.queryShopCartByuid(uid);
    }

    @Override
    public int delShopCart(int id) throws Exception {
        return shopCartDao.delShopCart(id);
    }

    @Override
    public List<ShopCart> queryShopCartBypid(int pid) throws SQLException {
        return shopCartDao.getBypid(pid);
    }

    @Override
    public int updateShoItem(ShopCart shopCart) throws SQLException {
        return shopCartDao.updateShopCartItem(shopCart);
    }
}
